﻿using System;

using DevExpress.Xpo;

using DevExpress.Persistent.Base;
using DevExpress.Persistent.BaseImpl;
using DevExpress.Persistent.Validation;
using System.ComponentModel;
using DevExpress.ExpressApp;
using DevExpress.Data.Filtering;

namespace SpeedSCM.Module
{
    [NavigationItem("库存管理")]
    [ImageName("BO_Address")]
    [RuleCombinationOfPropertiesIsUnique(null, DefaultContexts.Save, "仓库名称,商品名称", CustomMessageTemplate = "仓库已经存在该商品")]
    public class 库存 : BaseObject
    {
        public 库存(Session session)
            : base(session)
        {

        }
        private 仓库 _仓库名称;
        [Custom("Caption", "仓库名称")]
        [RuleRequiredField(null, DefaultContexts.Save, "必须选择仓库")]
        public 仓库 仓库名称
        {
            get { return _仓库名称; }
            set { SetPropertyValue<仓库>("仓库名称", ref _仓库名称, value); }
        }
        private 商品 _商品名称;
        [Custom("Caption", "商品名称")]
        [RuleRequiredField(null, DefaultContexts.Save, "必须选择商品")]
        public 商品 商品名称
        {
            get { return _商品名称; }
            set { SetPropertyValue<商品>("商品名称", ref _商品名称, value); }
        }

        private decimal _库存数量;
        [Custom("Caption", "库存数量")]
        [Custom("EditMask", "n2")]
        [Custom("DisplayFormat", "{0:n2}")]
        [RuleRequiredField]
        public decimal 库存数量
        {
            get { return _库存数量; }
            set { SetPropertyValue<decimal>("库存数量", ref _库存数量, value); }
        }
        private decimal _进货总价;
        [Custom("Caption", "进货总价")]
        public decimal 进货总价
        {
            get { return _进货总价; }
            set { SetPropertyValue<decimal>("进货总价", ref _进货总价, value); }
        }


        //private decimal _成本总价;
        //[Custom("Caption", "成本总价")]
        //public decimal 成本总价
        //{
        //    get { return _成本总价; }
        //    set { SetPropertyValue<decimal>("成本总价", ref _成本总价, value); }
        //}
        private decimal _销售总价;
        [Custom("Caption", "销售总价")]
        public decimal 销售总价
        {
            get { return _销售总价; }
            set { SetPropertyValue<decimal>("销售总价", ref _销售总价, value); }
        }


    }
}
